<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style>
   
</style>
</head>
<body>
        <form method="post" action="#">
                <div id="div" style="height: 200px; width: 200px; border: 1px solid red;">
                </div>
            </form>
</body>
<script src="../js/jquery-1.7.1.min.js"></script>
<script>
        $(function () {
            // 可以获取多个div
            $("#div","div2").click(function () {
                debugger;
                var css = $("#div").attr("style");
                if (css.indexOf("border: 1px solid red")>=0)
                    $(this).css("border", "1px solid blue");
                else
                    $(this).css("border", "1px solid red");
            });
        })
</script>
</html>